// 表格列
import tagRender from '@/components/aggridCellRenDerer/tagRender.vue'

let tableColumns: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '单号',
        field: 'code',
        width: 180,
    },
    {
        headerName: '公司',
        field: 'companyName',
        width: 180,
    },
    {
        headerName: '固定资产编号',
        field: 'numberId',
        width: 180,
    },
    {
        headerName: '所属区域',
        field: 'district',
        width: 180,
    },
    {
        headerName: '位置号',
        field: 'floorDistrict',
        width: 180,
    },
    {
        headerName: '购入金额',
        field: 'price',
        width: 180,
    },
    {
        headerName: '资产类型',
        field: 'propertyType',
        width: 180,
    },
    {
        headerName: '分摊类型',
        field: 'shareType',
        width: 180,
    },

    {
        headerName: '分摊年限',
        field: 'shareYears',
        width: 180,
    },
    {
        headerName: '报废原因',
        field: 'scrapWay',
        width: 195,
    },
    {
        headerName: '报废金额',
        field: 'scrapMoney',
        width: 180,
    },
    // {
    //     headerName: '购入金额',
    //     field: 'joinMoney',
    //     width: 180,
    // },
    // {
    //     headerName: '物料类别',
    //     field: 'majorCategory',
    //     width: 180,
    // },
    {
        headerName: '物料大类',
        field: 'majorCategory',
        width: 150,
    },
    {
        headerName: '物料中类',
        field: 'middleCategory',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subCategory',
        width: 150,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 180,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 180,
    },
    {
        headerName: '所借/移入公司',
        field: 'borrowCompanyName',
        width: 180,
    },
    {
        headerName: '所借/移入部门',
        field: 'needDepartmentName',
        width: 180,
    },
    {
        headerName: '借用/转移人',
        field: 'needPerson',
        width: 180,
    },
    {
        headerName: '库存状态',
        field: 'stockState',
        width: 180,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.stockState == 0
                    ? 'warning'
                    : params.stockState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.stockState == 0
                    ? '未出库'
                    : params.stockState == 1
                        ? '已出库'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams:{
            valueFormatter: function (params: any) {
              return params.value == '0'
                ? '未出库'
                : params.value == '1'
                ? '已出库'
                : ''
            },
          }
    },
    {
        headerName: '转移状态',
        field: 'fixedShiftState',
        width: 180,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.fixedShiftState == 0
                    ? 'warning'
                    : params.fixedShiftState == 1
                        ? 'success'
                        : params.fixedShiftState == 2
                            ? 'info'
                            : ''
            },
            text: (params: any) => {
                return params.fixedShiftState == 0
                    ? '未转移'
                    : params.fixedShiftState == 1
                        ? '转移中'
                        : params.fixedShiftState == 2
                            ? '转移已接收'
                            : ''
            },
            eltagSize: 0,
        },
        filterParams:{
            valueFormatter: function (params: any) {
              return params.value == '0'
                ? '未转移'
                : params.value == '1'
                ? '转移中'
                : params.value == '2'
                ? '转移已接收'
                : ''
            },
          }
    },
    {
        headerName: '借出状态',
        field: 'fixedAssetsBorrowState',
        width: 180,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.fixedAssetsBorrowState == 0
                    ? 'info'
                    : params.fixedAssetsBorrowState == 1
                        ? 'success'
                        : params.fixedAssetsBorrowState == 2
                            ? 'warning'
                            : params.fixedAssetsBorrowState == 3
                                ? 'danger'
                                : ''
            },
            text: (params: any) => {
                return params.fixedAssetsBorrowState == 0
                    ? '未借出'
                    : params.fixedAssetsBorrowState == 1
                        ? '待借出'
                        : params.fixedAssetsBorrowState == 2
                            ? '已借出'
                            : params.fixedAssetsBorrowState == 3
                                ? '已归还'
                                : ''
            },
            eltagSize: 0,
        },
        filterParams:{
            valueFormatter: function (params: any) {
              return params.value == '0'
                ? '未借出'
                : params.value == '1'
                ? '待借出'
                : params.value == '2'
                ? '已借出'
                : params.value == '2'
                ? '已归还'
                : ''
            },
          }
    },
    {
        headerName: '报废状态',
        field: 'fixedScrapState',
        width: 180,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.fixedScrapState == 0
                    ? 'warning'
                    : params.fixedScrapState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.fixedScrapState == 0
                    ? '未报废'
                    : params.fixedScrapState == 1
                        ? '已报废'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams:{
            valueFormatter: function (params: any) {
              return params.value == '0'
                ? '未报废'
                : params.value == '1'
                ? '已报废'
                : ''
            },
          }
    },
    {
        headerName: '借用/转移时间',
        field: 'needTime',
        width: 180,
    },
    {
        headerName: '备注',
        field: 'remark',
        width: 180,
    },
]

export {
    tableColumns,
}